package generics.practices;

interface Interface1{
	void f1();
}

interface Interface2{
	void f2();
}

class ImplementsInterface{
	
	public <T extends Interface1> void method1(T t){
		t.f1();
	}
	public <T extends Interface2> void method2(T t){
		t.f2();
	}
}

class Class1 implements Interface1{
	public void f1(){
		System.out.println("f1");
	}
}

class Class2 implements Interface2{
	public void f2(){
		System.out.println("f2");
	}
}

public class Practice25 {
	
	public static void main(String[] args) {
		ImplementsInterface ii = new ImplementsInterface();
		ii.method1(new Class1());
		ii.method2(new Class2());
	}
}
